/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   Module Name          : com.yaodian100.ec.image.web.ImageAction
   Module Description   :

   Date Created      : 2009/11/19
   Original Author   : ellen.li
   Team              : yaodian100
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   MODIFICATION HISTORY
   ------------------------------------------------------------------------------
   Date Modified       Modified by       Comments
   ------------------------------------------------------------------------------
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
package com.yaodian100.ec.image.web;

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang.xwork.StringUtils;
import org.apache.struts2.ServletActionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;
import com.yaodian100.core.common.dao.impl.CommonCriteria;
import com.yaodian100.core.common.service.BaseManager;
import com.yaodian100.core.common.utils.ServerValue;
import com.yaodian100.ec.image.entity.Image;
import com.yaodian100.ec.image.entity.Image.IMG_TYPE;
import com.yaodian100.ec.image.service.Image2Service;
import com.yaodian100.ec.product.entity.Product;
import com.yaodian100.ec.product.entity.SpecificationMajor;
import com.yaodian100.ec.product.service.Product2Service;
import com.yaodian100.ec.proposeproduct.service.ProposeProductService;

/**
 * @author ellen.li
 * 
 */
public class Image2Action extends ActionSupport implements Preparable {

	/**
	 * serial version
	 */
	private static final long serialVersionUID = -5924544703072058699L;

	private final Logger logger = LoggerFactory.getLogger(Image2Action.class);
	@Autowired
	private Image2Service image2Service;
	@Autowired
	private BaseManager baseMgr;
	@Autowired
	private Product2Service product2Service;
	@Autowired
	private ProposeProductService proposeProductService;
	@Autowired
	private JdbcTemplate jdbcTemplate;
	private Image image;
	private File[] batch;
	private Long[] batchDetails;
	private Long[] imgIds;
	private String productId;// 商品编号
	private String productName;// 商品名称
	private List<Image> images;// 图檔集合
	private List<Image> specImgs;// 规格图檔集合
	private Map<Long, Map<String, List<Image>>> majorSpecImgMap;
	private Long[] deletePic;
	private String imgId;
	private int imgSize;
	private Map<String, String> imageTypeMap;
	private String selImageType;// 图檔类型
	private Product product;
	private String mainSpecId;
	private String coverId;

	private File[] icon;
	private File[] main;
	private File[] rmain;
	private File[] spec;
	private File[] imageDesc;
	private String[] imageDescFileName;
	private File[] imagePrdt;
	private String[] imagePrdtFileName;
	private String tempIcon;
	private String tempMain;
	private String tempRmain;
	private String cover;
	private int mainImgSize;
	private Long[] delSpecImgIds;
	private String[] updSpecImgData;
	private Long[] specImgIds;
	private File[] updMain;
	private File[] newMain;
	private String nowStep = "3";
	private Map<String, String> prodImgMsg;

	/* 明细页 */
	private List<Image> iconImg = null;
	private List<Image> mainImg = null;
	private List<Image> rmainImg = null;
	private List<Image> mspecImg = null;
	private List<Image> rmspecImg = null;

	/**
	 * 设为封面
	 * 
	 * @return
	 * @throws Exception
	 */
	public String changeCover() throws Exception {
		if (StringUtils.isNotBlank(mainSpecId) && StringUtils.isNotBlank(productId)) {
			try {
				image2Service.changeCover(productId, Long.parseLong(mainSpecId));
				coverId = mainSpecId;
			} catch (Exception e) {
				coverId = "";
			}
		}
		return "jsonChangeCover";
	}

	public String list() throws Exception {
		return "list";
	}

	public String saveImgStep() throws Exception {
		HttpServletResponse response = (HttpServletResponse) ActionContext.getContext().get(
				ServletActionContext.HTTP_RESPONSE);
		if (StringUtils.isBlank(productId) || StringUtils.length(productId) != 8 || !NumberUtils.isNumber(productId)) {
			addActionError("传入参数错误");
			return list();
		} else {
			product = product2Service.get(productId);
			if (null == product) {
				addActionError("查无商品资料(或无该权限查看)");
				return list();
			} else {
				if (product.getProductType() != 6) {
					response
							.sendRedirect(ServerValue.getMidContextPath() + "/shelf2/list.do?productId=" + product.getProductId());
				} else {
					response.sendRedirect(ServerValue.getMidContextPath() + "/pickProduct2/editPickProduct.do?productIdParam="
							+ product.getProductId());
				}
			}
			return edit();
		}
	}

	/**
	 * 批次处理檔案(删除、异动顺序、替换图檔)
	 * 
	 * @return
	 * @throws Exception
	 */
	public String batchProcessImage() throws Exception {
		try {
			Map<Long, File> replaceImgFiles = new HashMap<Long, File>();
			int i = 0;
			if (null != batch) {
				for (Long picImgDetail : batchDetails) {
					replaceImgFiles.put(picImgDetail, batch[i]);
					i++;
				}
			}
			image2Service.batchProcessImage(deletePic, imgIds, replaceImgFiles);
			addActionMessage("储成完成");
		} catch (Exception e) {
			addActionError(e.fillInStackTrace().toString());
		}
		deletePic = null;
		batch = null;
		imgIds = null;
		return edit();
	}

	public String viewImgDetail() throws Exception {
		if (StringUtils.isBlank(productId) || StringUtils.length(productId) != 8 || !NumberUtils.isNumber(productId)) {
			addActionError("传入参数错误");
			return list();
		} else {
			product = product2Service.get(productId);
			if (null == product) {
				addActionError("查无商品资料(或无该权限查看)");
				return list();
			} else {
				CommonCriteria crit = new CommonCriteria();
				productName = product.getProductName();
				crit.addEq("isDelete", "N");
				crit.addEq("productId", productId);
				crit.addEq("mainSpecId", Long.parseLong(mainSpecId));
				crit.addIn("type", Arrays.asList(IMG_TYPE.ICON.getValue(), IMG_TYPE.MAIN.getValue(), IMG_TYPE.RMAIN.getValue(),
						IMG_TYPE.MSPEC.getValue(), IMG_TYPE.RMSPEC.getValue()));
				List<Image> images = image2Service.getList(0, -1, crit, new String[] { "type asc", "showSeq asc" });
				iconImg = new ArrayList<Image>();
				mainImg = new ArrayList<Image>();
				rmainImg = new ArrayList<Image>();
				mspecImg = new ArrayList<Image>();
				rmspecImg = new ArrayList<Image>();
				for (Image image : images) {
					if (IMG_TYPE.ICON.getValue().equals(image.getType())) {
						iconImg.add(image);
					}
					if (IMG_TYPE.MAIN.getValue().equals(image.getType())) {
						mainImg.add(image);
					}
					if (IMG_TYPE.RMAIN.getValue().equals(image.getType())) {
						rmainImg.add(image);
					}
					if (IMG_TYPE.MSPEC.getValue().equals(image.getType())) {
						mspecImg.add(image);
					}
					if (IMG_TYPE.RMSPEC.getValue().equals(image.getType())) {
						rmspecImg.add(image);
					}
				}
			}
		}
		return "viewImgDetail";
	}

	/**
	 * 選擇上傳圖檔
	 * 
	 * @return
	 * @throws Exception
	 */
	public String edit() throws Exception {
		try {
			if (StringUtils.isBlank(productId) || StringUtils.length(productId) != 8 || !NumberUtils.isNumber(productId)) {
				addActionError("传入参数错误");
				return list();
			} else {
				product = product2Service.get(productId);
				if (null == product) {
					addActionError("查无商品资料(或无该权限查看)");
					return list();
				} else {
					CommonCriteria crit = new CommonCriteria();
					productName = product.getProductName();
					crit.addEq("isDelete", "N");
					crit.addEq("productId", productId);
					crit.addEq("mainSpecId", null);
					if (StringUtils.isBlank(selImageType)) {
						selImageType = IMG_TYPE.MAIN.getValue();
					}
					crit.addEq("type", selImageType);
					String[] sort = { "type", "showSeq asc", "id asc" };
					images = image2Service.getList(0, -1, crit, sort);
					// 商品圖筆數(大小圖加起來不可大於20筆)
					crit = new CommonCriteria();
					crit.addEq("productId", productId);
					crit.addIn("type", Arrays.asList("IMGB", "IMGS"));
					crit.addEq("isDelete", "N");
					imgSize = image2Service.getListSize(crit).intValue();

					List<SpecificationMajor> majors = product.getSpecMajors();
					List<Image> tmpIconList = null;
					List<Image> tmpMainList = null;
					List<Image> tmpRmainList = null;
					Map<String, List<Image>> typeImgMap = null;
					majorSpecImgMap = new HashMap<Long, Map<String, List<Image>>>();
					mainImgSize = 0;

					if (null != majors && majors.size() > 0) {
						if (product.getProductType() != 6) {
							crit = new CommonCriteria();
							crit.addEq("productId", product.getProductId());
							crit.addIn("type", Arrays.asList(IMG_TYPE.ICON.getValue(), IMG_TYPE.MAIN.getValue(), IMG_TYPE.RMAIN
									.getValue()));
							crit.addEq("isDelete", "N");
							Long imageSize = image2Service.getListSize(crit).longValue();
							if (imageSize > 0) {// 有圖檔才檢查是否有設規格封面，若沒有則default第一個規格為封面
								Long coverSize = baseMgr.countByHql("from SpecificationMajor where isCover = 'Y' and productId = ?",
										new Object[] { productId });
								logger.info("coverSize:{}", coverSize);
								if (coverSize == 0) {
									Long coverId = null;// major 封面id
									Object[] objs = baseMgr
											.queryByHql(
													"select mainSpecId from SpecificationMajor where isCover = 'Y' and isDelete = 'N' and productId = ?  order by showSeq asc",
													new Object[] { productId });
									if (null == objs || objs.length == 0) {
										Object[] objs2 = baseMgr
												.queryByHql(
														"select mainSpecId from SpecificationMajor where isCover = 'N' and isDelete = 'N' and productId = ? order by showSeq asc",
														new Object[] { productId });
										coverId = Long.parseLong(objs2[0].toString());
										logger.info("n coverId:{}", coverId);
										image2Service.changeCover(productId, coverId);
									}
								} else {// 有多個規格被設為封面,則將最後一個是封面的規格設為主封面
									Long coverId = null;// major 封面id
									Object[] objs = baseMgr
											.queryByHql(
													"select mainSpecId from SpecificationMajor where isCover = 'Y' and isDelete = 'N' and productId = ? order by showSeq desc",
													new Object[] { productId });
									if (null != objs && objs.length > 1) {
										coverId = Long.parseLong(objs[0].toString());
										image2Service.changeCover(productId, coverId);
									}
								}
							}
						}
						// majors = jdbcTemplate.u.queryForList(
						// "select * from ec_specification_major where is_delete = 'N' and product_id = '" + productId + "' ",
						// SpecificationMajor.class);
						// Object[] majorObjs = baseMgr.queryByHql("from SpecificationMajor where isDelete = 'N' and productId = ?",
						// new Object[] { productId });
						product = (Product) baseMgr.get(Product.class, productId);
						for (SpecificationMajor major : product.getSpecMajors()) {
							// SpecificationMajor major = (SpecificationMajor) majorObj;
							// for (SpecificationMajor major : majors) {
							logger.info("major :{} {}", major.getMainSpecId(), major.getIsCover());
							crit = new CommonCriteria();
							crit.addEq("productId", product.getProductId());
							crit.addIn("type", Arrays.asList(IMG_TYPE.ICON.getValue(), IMG_TYPE.MAIN.getValue(), IMG_TYPE.RMAIN
									.getValue()));
							crit.addEq("isDelete", "N");
							crit.addEq("mainSpecId", major.getMainSpecId());
							specImgs = image2Service.getList(0, -1, crit, new String[] { "showSeq asc" });
							tmpIconList = new ArrayList<Image>();
							tmpMainList = new ArrayList<Image>();
							tmpRmainList = new ArrayList<Image>();
							typeImgMap = new HashMap<String, List<Image>>();
							for (Image specImg : specImgs) {
								if (IMG_TYPE.ICON.getValue().equals(specImg.getType())) {
									tmpIconList.add(specImg);
								}
								if (IMG_TYPE.MAIN.getValue().equals(specImg.getType())) {
									tmpMainList.add(specImg);
									mainImgSize++;
								}
								if (IMG_TYPE.RMAIN.getValue().equals(specImg.getType())) {
									tmpRmainList.add(specImg);
									mainImgSize++;
								}
							}
							typeImgMap.put(IMG_TYPE.ICON.getValue(), tmpIconList);
							typeImgMap.put(IMG_TYPE.MAIN.getValue(), tmpMainList);
							typeImgMap.put(IMG_TYPE.RMAIN.getValue(), tmpRmainList);
							majorSpecImgMap.put(major.getMainSpecId(), typeImgMap);
						}
					}
				}
			}
		} catch (Exception e) {
			addActionError(e.fillInStackTrace().toString());
		}
		icon = null;
		main = null;
		rmain = null;
		newMain = null;
		updSpecImgData = null;
		updMain = null;
		delSpecImgIds = null;
		if (product.getProductType() != 6) {
			nowStep = "3";
			return "edit";
		} else {
			nowStep = "2";
			return "editPick";
		}
	}

	/**
	 * 储存规格图
	 * 
	 * @return
	 * @throws Exception
	 */
	public String uploadSpecImg() throws Exception {
		product = product2Service.get(productId);
		List<String> typeList = new ArrayList<String>();
		List<String> specIdList = new ArrayList<String>();
		List<File> fileList = new ArrayList<File>();
		CommonCriteria crit = new CommonCriteria();
		Map<String, Integer> imgShowSeqData = null;
		Map<Long, File> replaceImgFiles = null;
		crit.addEq("productId", product.getProductId());
		crit.addIn("type", Arrays.asList(IMG_TYPE.ICON.getValue(), IMG_TYPE.MAIN.getValue(), IMG_TYPE.RMAIN.getValue()));
		crit.addEq("isDelete", "N");
		crit.addNe("mainSpecId", null);
		Number size = image2Service.getListSize(crit);

		if (StringUtils.isNotBlank(tempMain)) {
			String[] tempMainArray = tempMain.split(",");
			for (int i = 0; i < tempMainArray.length; i++) {
				typeList.add(IMG_TYPE.MAIN.getValue());
				specIdList.add(tempMainArray[i]);
			}
		}
		if (StringUtils.isNotBlank(tempRmain)) {
			String[] tempRmainArray = tempRmain.split(",");
			for (int i = 0; i < tempRmainArray.length; i++) {
				typeList.add(IMG_TYPE.RMAIN.getValue());
				specIdList.add(tempRmainArray[i]);
			}
		}
		if (StringUtils.isNotBlank(tempIcon)) {
			String[] tempIconArray = tempIcon.split(",");
			for (int i = 0; i < tempIconArray.length; i++) {
				typeList.add(IMG_TYPE.ICON.getValue());
				specIdList.add(tempIconArray[i]);
			}
		}

		// 一定要先放入主规格方形及长形图，再放入icon，否则icon的图会被主规格产生的icon图盖掉
		if (null != main) {
			for (int i = 0; i < main.length; i++) {
				if (null != main[i]) {
					fileList.add(main[i]);
				}
			}
		}

		if (null != rmain) {
			for (int i = 0; i < rmain.length; i++) {
				fileList.add(rmain[i]);
			}
		}
		if (product.getProductType() != 6) {// n選m沒有icon
			if (null != icon) {
				for (int i = 0; i < icon.length; i++) {
					fileList.add(icon[i]);
				}
			}
		}

		// 修改时才会用到

		if (null != updSpecImgData) {
			int i = 0;
			replaceImgFiles = new HashMap<Long, File>();
			List<String> specShowSeqData = new ArrayList<String>();
			for (String specImgData : updSpecImgData) {
				if (StringUtils.isNotBlank(specImgData)) {
					String[] tempSplit = specImgData.split("#");
					specShowSeqData.add(specImgData);
					if (null != updMain) {
						if (StringUtils.equals("upd", tempSplit[1])) {// 置换檔案
							replaceImgFiles.put(Long.parseLong(tempSplit[3]), updMain[i]);
							i++;
						}
						if (StringUtils.equals("new", tempSplit[1])) {// 置换檔案
							typeList.add("NEWMAIN");
							specIdList.add(tempSplit[0]);
							fileList.add(updMain[i]);
							i++;
						}
					}
				}
			}
			imgShowSeqData = new LinkedHashMap<String, Integer>();
			int k = 0;
			Map<String, Integer> a = new HashMap<String, Integer>();
			for (String specShowSeqData1 : specShowSeqData) {
				String[] tempSplit = specShowSeqData1.split("#");
				if (!a.containsKey(tempSplit[0])) {
					a.put(tempSplit[0], 2);
				} else {
					a.put(tempSplit[0], a.get(tempSplit[0]) + 1);
				}
				if (StringUtils.equals("new", tempSplit[1]) || StringUtils.equals("upd", tempSplit[1])) {
					imgShowSeqData.put(updMain[k].getName(), a.get(tempSplit[0]));
					k++;
				} else {
					imgShowSeqData.put(tempSplit[2], a.get(tempSplit[0]));
				}
			}
		}
		if (!typeList.isEmpty() && !specIdList.isEmpty() || null != delSpecImgIds || imgShowSeqData.size() > 0) {
			image2Service.uploadImage(productId, typeList, specIdList, fileList, null, StringUtils.defaultString(cover, ""),
					delSpecImgIds, replaceImgFiles, imgShowSeqData);
			addActionMessage("储成完成");
		}
		return edit();
	}

	@Override
	public String execute() throws Exception {
		return SUCCESS;
	}

	public Long[] getDeletePic() {
		return deletePic;
	}

	/**
	 * @return the image
	 */
	public Image getImage() {
		return image;
	}

	/**
	 * @return the images
	 */
	public List<Image> getImages() {
		return images;
	}

	public Map<String, String> getImageTypeMap() {
		return imageTypeMap;
	}

	public String getImgId() {
		return imgId;
	}

	public Long[] getImgIds() {
		return imgIds;
	}

	public int getImgSize() {
		return imgSize;
	}

	/**
	 * @return the productId
	 */
	public String getProductId() {
		return productId;
	}

	/**
	 * @return the productName
	 */
	public String getProductName() {
		return productName;
	}

	public ProposeProductService getProposeProductService() {
		return proposeProductService;
	}

	public String getSelImageType() {
		return selImageType;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.opensymphony.xwork2.Preparable#prepare()
	 */
	@Override
	public void prepare() throws Exception {
		clearErrorsAndMessages();
		if (null == imageTypeMap) {
			imageTypeMap = new LinkedHashMap<String, String>();
			imageTypeMap.put("MAIN", "封面方形主檔图");
			imageTypeMap.put("RMAIN", "封面长形主檔图");
			imageTypeMap.put("DESC", "描述图");
			imageTypeMap.put("IMGB", "其他图");
		}
	}

	public void setDeletePic(Long[] deletePic) {
		this.deletePic = deletePic;
	}

	/**
	 * @param image the image to set
	 */
	public void setImage(Image image) {
		this.image = image;
	}

	/**
	 * @param images the images to set
	 */
	public void setImages(List<Image> images) {
		this.images = images;
	}

	public void setImageTypeMap(Map<String, String> imageTypeMap) {
		this.imageTypeMap = imageTypeMap;
	}

	public void setImgId(String imgId) {
		this.imgId = imgId;
	}

	public void setImgIds(Long[] imgIds) {
		this.imgIds = imgIds;
	}

	public void setImgSize(int imgSize) {
		this.imgSize = imgSize;
	}

	/**
	 * @param productId the productId to set
	 */
	public void setProductId(String productId) {
		this.productId = productId;
	}

	/**
	 * @param productName the productName to set
	 */
	public void setProductName(String productName) {
		this.productName = productName;
	}

	/**
	 * @param productService the productService to set
	 */
	public void setProduct2Service(Product2Service product2Service) {
		this.product2Service = product2Service;
	}

	public void setProposeProductService(ProposeProductService proposeProductService) {
		this.proposeProductService = proposeProductService;
	}

	public void setSelImageType(String selImageType) {
		this.selImageType = selImageType;
	}

	public String toEditImgDetail() {
		if (!StringUtils.isBlank(imgId)) {
			image = image2Service.get(Long.parseLong(imgId));
		}
		setImage(image);
		return "editImgDetail";
	}

	/**
	 * 上傳說明圖片
	 * 
	 * @return
	 * @throws Exception
	 */
	public String uploadProdImg() throws Exception {
		try {
			List<String> typeList = new ArrayList<String>();
			List<File> fileList = new ArrayList<File>();
			List<String> fileNameList = new ArrayList<String>();
			String descMsg = "";
			String prdtMsg = "";
			if (null != imageDesc) {
				for (int i = 0; i < imageDesc.length; i++) {
					typeList.add(IMG_TYPE.DESC.getValue());
					fileList.add(imageDesc[i]);
					fileNameList.add(imageDescFileName[i]);
				}
				descMsg = image2Service.chkFileSize(IMG_TYPE.DESC.getValue(), fileList, fileNameList);
			}
			if (null != imagePrdt) {
				for (int i = 0; i < imagePrdt.length; i++) {
					typeList.add(IMG_TYPE.PRDT.getValue());
					fileList.add(imagePrdt[i]);
					fileNameList.add(imagePrdtFileName[i]);
				}
				prdtMsg = image2Service.chkFileSize(IMG_TYPE.PRDT.getValue(), fileList, fileNameList);
			}
			// 檔案尺寸不符
			if (StringUtils.isNotBlank(prdtMsg) || StringUtils.isNotBlank(descMsg)) {
				addActionError(descMsg + "\n" + prdtMsg);
			} else {
				if (!typeList.isEmpty() && typeList.size() > 0) {
					image2Service.uploadImage(productId, typeList, null, fileList, fileNameList);
					addActionMessage("储成完成");
				}
			}
		} catch (Exception e) {
			addActionError(e.fillInStackTrace().toString());
		}
		imageDesc = null;
		imagePrdt = null;
		return edit();
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public String getMainSpecId() {
		return mainSpecId;
	}

	public void setMainSpecId(String mainSpecId) {
		this.mainSpecId = mainSpecId;
	}

	public File[] getIcon() {
		return icon;
	}

	public void setIcon(File[] icon) {
		this.icon = icon;
	}

	public File[] getMain() {
		return main;
	}

	public File[] getRmain() {
		return rmain;
	}

	public void setMain(File[] main) {
		this.main = main;
	}

	public void setRmain(File[] rmain) {
		this.rmain = rmain;
	}

	public String getCoverId() {
		return coverId;
	}

	public String getTempIcon() {
		return tempIcon;
	}

	public void setCoverId(String coverId) {
		this.coverId = coverId;
	}

	public void setTempIcon(String tempIcon) {
		this.tempIcon = tempIcon;
	}

	public File[] getSpec() {
		return spec;
	}

	public void setSpec(File[] spec) {
		this.spec = spec;
	}

	public File[] getImagePrdt() {
		return imagePrdt;
	}

	public void setImagePrdt(File[] imagePrdt) {
		this.imagePrdt = imagePrdt;
	}

	public String[] getImagePrdtFileName() {
		return imagePrdtFileName;
	}

	public File[] getImageDesc() {
		return imageDesc;
	}

	public String[] getImageDescFileName() {
		return imageDescFileName;
	}

	public void setImageDesc(File[] imageDesc) {
		this.imageDesc = imageDesc;
	}

	public void setImageDescFileName(String[] imageDescFileName) {
		this.imageDescFileName = imageDescFileName;
	}

	public void setImagePrdtFileName(String[] imagePrdtFileName) {
		this.imagePrdtFileName = imagePrdtFileName;
	}

	public String getTempMain() {
		return tempMain;
	}

	public String getTempRmain() {
		return tempRmain;
	}

	public void setTempMain(String tempMain) {
		this.tempMain = tempMain;
	}

	public void setTempRmain(String tempRmain) {
		this.tempRmain = tempRmain;
	}

	public List<Image> getSpecImgs() {
		return specImgs;
	}

	public void setSpecImgs(List<Image> specImgs) {
		this.specImgs = specImgs;
	}

	public Map<Long, Map<String, List<Image>>> getMajorSpecImgMap() {
		return majorSpecImgMap;
	}

	public void setMajorSpecImgMap(Map<Long, Map<String, List<Image>>> majorSpecImgMap) {
		this.majorSpecImgMap = majorSpecImgMap;
	}

	public int getMainImgSize() {
		return mainImgSize;
	}

	public void setMainImgSize(int mainImgSize) {
		this.mainImgSize = mainImgSize;
	}

	public Long[] getDelSpecImgIds() {
		return delSpecImgIds;
	}

	public void setDelSpecImgIds(Long[] delSpecImgIds) {
		this.delSpecImgIds = delSpecImgIds;
	}

	public File[] getUpdMain() {
		return updMain;
	}

	public File[] getNewMain() {
		return newMain;
	}

	public void setUpdMain(File[] updMain) {
		this.updMain = updMain;
	}

	public void setNewMain(File[] newMain) {
		this.newMain = newMain;
	}

	public Long[] getSpecImgIds() {
		return specImgIds;
	}

	public void setSpecImgIds(Long[] specImgIds) {
		this.specImgIds = specImgIds;
	}

	public String[] getUpdSpecImgData() {
		return updSpecImgData;
	}

	public void setUpdSpecImgData(String[] updSpecImgData) {
		this.updSpecImgData = updSpecImgData;
	}

	public File[] getBatch() {
		return batch;
	}

	public void setBatch(File[] batch) {
		this.batch = batch;
	}

	public Long[] getBatchDetails() {
		return batchDetails;
	}

	public void setBatchDetails(Long[] batchDetails) {
		this.batchDetails = batchDetails;
	}

	public String getCover() {
		return cover;
	}

	public void setCover(String cover) {
		this.cover = cover;
	}

	public String getNowStep() {
		return nowStep;
	}

	public void setNowStep(String nowStep) {
		this.nowStep = nowStep;
	}

	public List<Image> getIconImg() {
		return iconImg;
	}

	public List<Image> getMainImg() {
		return mainImg;
	}

	public List<Image> getRmainImg() {
		return rmainImg;
	}

	public List<Image> getMspecImg() {
		return mspecImg;
	}

	public List<Image> getRmspecImg() {
		return rmspecImg;
	}

	public void setIconImg(List<Image> iconImg) {
		this.iconImg = iconImg;
	}

	public void setMainImg(List<Image> mainImg) {
		this.mainImg = mainImg;
	}

	public void setRmainImg(List<Image> rmainImg) {
		this.rmainImg = rmainImg;
	}

	public void setMspecImg(List<Image> mspecImg) {
		this.mspecImg = mspecImg;
	}

	public void setRmspecImg(List<Image> rmspecImg) {
		this.rmspecImg = rmspecImg;
	}

	public Map<String, String> getProdImgMsg() {
		return prodImgMsg;
	}

	public void setProdImgMsg(Map<String, String> prodImgMsg) {
		this.prodImgMsg = prodImgMsg;
	}
}